﻿namespace Test
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string filePath = Path.Combine(AppContext.BaseDirectory, "test.xlsx");
            var er = new ShExcelLib.ExcelReader(filePath);
            var cfg = new ShExcelLib.ReadConfig
            {
                SheetName = "测试数据表",
                //SheetIndex = 1,
                HeadRowNum = 2,
                DataRowNum = 3,

                //配置第1项为空，表示可以跳过A列
                //如果不配置以下行，则 HeadRowNum = 2 则会生效
                ColumnNames = new[] { "", "rowNum","account","name","score","submitTime"}
            };
            int count = 0;
            er.Read(cfg, (json) =>
            {
                count++;
                Console.Write("[{0}] ", count);
                Console.WriteLine(json.ToString(Newtonsoft.Json.Formatting.None));
            });
            Console.WriteLine("done");
        }
    }
}